package com.liao.service;

import com.liao.bean.Role;
import com.liao.bean.User;
import com.liao.bean.result.PageResult;
import org.springframework.security.core.userdetails.UserDetailsService;

import java.util.List;

public interface UserService extends UserDetailsService {

    /**
     * 查询所有用户列表
     * @return
     * @throws Exception
     */
    List<User> selectUserList() throws Exception;

    /**
     * 用户登录
     * @param inputUser
     * @return
     * @throws Exception
     */
    User login(User inputUser) throws Exception;

    /**
     * 分页查询用户列表
     * @param currentPage
     * @param pageSize
     * @param userName
     * @return
     * @throws Exception
     */
    PageResult<User> queryRoleListByPage(Integer currentPage, Integer pageSize, String userName) throws Exception;

    /**
     * 添加用户
     * @param user
     * @throws Exception
     */
    void addUser(User user) throws Exception;

    /**
     * 修改用户
     * @param oldUserId
     * @param userId
     * @param userName
     * @param account
     * @param password
     * @throws Exception
     */
    void editUser(String oldUserId, String userId, String userName, String account, String password) throws Exception;

    /**
     * 查询所有用户信息
     * @return
     * @throws Exception
     */
    List<Role> queryUserList() throws Exception;

    /**
     * 根据id删除用户
     * @param userId
     * @throws Exception
     */
    void deleteUser(String userId) throws Exception;
}
